package com.at.functions5;

import com.at.bean.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * @author huangchao E-mail:fengquan8866@163.com
 * @version 创建时间：2024/9/25 16:50
 */
public class WaterSensorMapFunction3 implements MapFunction<String, WaterSensor> {
    private static final long serialVersionUID = -7060769605252200751L;

    @Override
    public WaterSensor map(String value) throws Exception {
        String[] datas = value.split(",");
        return new WaterSensor(datas[0], Long.parseLong(datas[1]), Integer.parseInt(datas[2]));
    }
}
